package com.liao.order.controller;

import com.liao.common.entity.order.OrderSettingEntity;
import com.liao.common.utils.PageUtils;
import com.liao.order.service.OrderSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.Map;


/**
 * 订单配置信息
 *
 * @author liao
 * @email 2858015963@qq.com
 * @date 2025-03-14 09:23:11
 */
@RestController
@RequestMapping("order/ordersetting")
public class OrderSettingController {
    @Autowired
    private OrderSettingService orderSettingService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    public PageUtils<OrderSettingEntity> list(@RequestParam Map<String, Object> params) {
        return orderSettingService.queryPage(params);

    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public OrderSettingEntity info(@PathVariable("id") Long id) {
        return orderSettingService.getById(id);

    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    public void save(@RequestBody OrderSettingEntity orderSetting) {
        orderSettingService.save(orderSetting);

    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public void update(@RequestBody OrderSettingEntity orderSetting) {
        orderSettingService.updateById(orderSetting);
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public void delete(@RequestBody Long[] ids) {
        orderSettingService.removeByIds(Arrays.asList(ids));
    }

}
